package cn.gson.crm.controller.job;

import java.util.List;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.StudentDao;
import cn.gson.crm.model.entity.Student;

@WebServlet("/job/follow")
public class JobFollowServlet extends BaseServlet{
	/**
	 *  获取所有已毕业的学员列表
	 */	private static final long serialVersionUID = 1L;
		StudentDao stuDao = new StudentDao();
		@Override
		protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
			String p = request.getParameter("page");
			String name = request.getParameter("name");
			String phone = request.getParameter("phone");
			if(p==null||p.isEmpty()){
				p="1";
			}
			Integer page = Integer.parseInt(p);
			//获取所有已毕业的学员
			List<Student>studentList =  stuDao.getStudentList(page, "8", name, phone);
			Integer totalPage = stuDao.getTotalPages("8", name, phone);
			request.setAttribute("totalPage", totalPage);
			request.setAttribute("studentList", studentList);
			request.setAttribute("queryString", noPageQueryString(request));
			request.setAttribute("page", page);
			getServletPathAndForward(request, "job/job_follow.jsp");
		}
}
